/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.irssproject.app.entitats;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author adria
 */
@Entity
@Table(name = "feeds")
@NamedQueries({
    @NamedQuery(name = "Feed.findAll", query = "SELECT f FROM Feed f")})
public class Feed implements Serializable {

    private static final long serialVersionUID = 1L;
    private Long id;
    private String link;
    private String titol;
    
    public Feed() {
    }

    public Feed(Long idfeed) {
        this.id = idfeed;
    }

    public Feed(Long idfeed, String link, String titol) {
        this.id = idfeed;
        this.link = link;
        this.titol = titol;
    }

    public Feed(String titol, String link) {
        this.titol = titol;
        this.link = link;
    }
    public Feed(String link) {
        this.link = link;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idfeed")
    public Long getId() {
        return id;
    }

    public void setId(Long idfeed) {
        this.id = idfeed;
    }

    @Basic(optional = false)
    @Column(name = "link")
    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    @Basic(optional = false)
    @Column(name = "titol")
    public String getTitol() {
        return titol;
    }

    public void setTitol(String titol) {
        this.titol = titol;
    }
    
	@Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Feed)) {
            return false;
        }
        Feed other = (Feed) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.irssproject.app.entitats.Feed[idfeed=" + id + "]";
    }
}
